<template>
  <div class="template2">
    <el-container>
      <div class="head" id="head1">
        <div class="tit">服务时间段配置
            <span class="add" @click="addTime('add')">添加</span>
            <span class="add" @click="areaAllocation()">面积配置</span>
        </div>
      </div>
      <el-main style="height:100%">
          <timeList></timeList>
      </el-main>
    </el-container>
    <addTime></addTime>
    <argeList></argeList>
    <addArge></addArge>
  </div>
</template>
<script>
import timeList from './timeList.vue'  //时间面积列表
import addTime from './addTime.vue' //添加时间
import argeList from './argeList.vue' //面积配置列表
import addArge from './addArge.vue' //面积配置列表
import { request } from "../../assets/request.js";
export default {
  data() {
    return {
      height: 0,
      listNum:10
    };
  },
  created() {
      this.measure()
  },
  methods: {
      addTime(type){ //添加时间
        this.$root.$emit('addTime',type)
      },
      measure(){ //房屋面积段
        let url = "constant/second/49";
        let that=this   //解决this指向问题
        // if(that.$store.state.serveRegion!=''){
        //   return
        // }
        request.ajaxGet({ //查找服务区域
            url,
            that,
            fn(res){
                that.$store.state.measure=res
                // console.log(that.$store.state.measure)
            }
        })
      },
      areaAllocation(){  //面积配置
        this.$root.$emit('areaAllocation','no')
      },
      selectList(){ //面积段
            let that=this
            let url='build/area'
            request.ajaxGet({
                url,
                that,
                fn(res){
                    // console.log(res.list)
                    that.gridData=res.list
                }
            })
        }
  },
  components:{
    timeList, //时间列表
    addTime,  //添加时间
    argeList, //面积配置列表
    addArge,  //添加面积段
  },
};
</script>
<style scoped lang="less">
@import "../template2.less";
</style>
<style lang="less" scoped>
.template2{
    padding: 60px 0px 0px 0px;
}
</style>
